﻿#region Copyright information
// 
// Copyright © 2005-2013 Yongkee Cho. All rights reserved.
// 
// This code is a part of the Biological Object Library and governed under the terms of the
// GNU Lesser General  Public License (LGPL) version 2.1 which accompanies this distribution.
// For more information on the LGPL, please visit http://bol.codeplex.com/license.
// 
// - Filename: DishonestCasino.cs
// - Author: Yongkee Cho
// - Email: yongkeecho@gmail.com
// - Date Created: 2013-01-24 4:34 PM
// - Last Modified: 2013-01-25 3:59 PM
// 
#endregion
using System.Collections.Generic;
using BOL.Maths.Distributions;

namespace BOL.Algorithms.StateMachines.Models
{
    public enum DishonestCasinoState { Fair, Loaded }

    /// <summary>
    /// Models a dishonest casino.
    /// </summary>
    public class DishonestCasino : HiddenMarkovModel<DishonestCasinoState, int>
    {
        public DishonestCasino()
            : base(
                new Dictionary<DishonestCasinoState, double> { { DishonestCasinoState.Fair, 0.7 }, { DishonestCasinoState.Loaded, 0.3 } },
                new Dictionary<DishonestCasinoState, IDistribution<int>>
                {
                    { DishonestCasinoState.Fair, new CategoricalDistribution<int>(new Dictionary<int, double> { { 1, 0.1667 }, { 2, 0.1667 }, { 3, 0.1667}, { 4, 0.1667 }, { 5, 0.1667 }, { 6, 0.1667 } }) },
                    { DishonestCasinoState.Loaded, new CategoricalDistribution<int>(new Dictionary<int, double> { { 1, 0.1 }, { 2, 0.1 }, { 3, 0.1 }, { 4, 0.1 }, { 5, 0.1 }, { 6, 0.5 } })}
                },
                new Dictionary<DishonestCasinoState, IDistribution<DishonestCasinoState>>
                {
                    { DishonestCasinoState.Fair, new CategoricalDistribution<DishonestCasinoState>(new Dictionary<DishonestCasinoState, double> { { DishonestCasinoState.Fair, 0.95 }, { DishonestCasinoState.Loaded, 0.05 } }) },
                    { DishonestCasinoState.Loaded, new CategoricalDistribution<DishonestCasinoState>(new Dictionary<DishonestCasinoState, double> { { DishonestCasinoState.Fair, 0.1 }, { DishonestCasinoState.Loaded, 0.9 } }) }
                }
            )
        {
        }
    }
}